#include<iostream>
#include<stack>



// 两个栈 实现一个队列
class MyQueue
{
    public:
    MyQueue(){}


    void Push(int value)
    {
        while(s2.empty() == false)
        {
            s1.push(s2.top());
            s2.pop();
        }
        s1.push(value);
    }

    void Pop()
    {
        while(s1.empty() == false)
        {
            s2.push(s1.top());
            s1.pop();
        }
        s2.pop();
    }

    bool IsEmpty()
    {
        return s1.empty() && s2.empty();
    }

    int GetFront()
    {
        while(s1.empty() == false)
        {
            s2.push(s1.top());
            s1.pop();
        }
        return s2.top();
        s2.pop();
    }


    private:
    std::stack<int> s1;
    std::stack<int> s2;
    
};









int main()
{
    std::stack<int> s;
    
    MyQueue q;

    q.Push(1);
    q.Push(2);
    std::cout<<q.GetFront()<<std::endl;
    
    q.Pop();
    q.Push(3);
    std::cout<<q.GetFront()<<std::endl;


    return 0;
}